package day03;

public class OperDemo1 {
    public static void main(String[] args) {

        System.out.println(7%5);//2
        System.out.println(2%4);//0
        System.out.println(6%3);//0
        System.out.println("-------------------------------");

        int a=5,b=6;
        a++;
        ++b;
        System.out.println(a);//6
        System.out.println(b);//7
        System.out.println("-------------------------------");

        int c=7,d=4;
        int e = c++;//c=8,e=7
        int f = ++d;//d=5,f=5
        System.out.println(c++ + ++b);//8+8=15
        System.out.println(d);//5
        System.out.println(e);//7
        System.out.println(f);//5
        System.out.println(c+" "+b);//9 8
        System.out.println("-------------------------------");

        int g = 7,h=10;
        g--;
        --h;
        System.out.println(g);//6
        System.out.println(h);//9
        System.out.println("-------------------------------");

        int i = 8,j=9;
        int m = i--;//i=7,m=8
        int n = --j;//n=8,j=8
        System.out.println(i);//7
        System.out.println(j);//8
        System.out.println(m);//8
        System.out.println(n);//8
        System.out.println("-------------------------------");
        int x = i-- + ++j + m++ + --n;//x = 7+9+8+7=31
        System.out.println("x="+x+",i="+i+",j="+j+",m="+m+",n="+n);//x=31,i=6,j=9,m=9,n=7



    }
}
